package org.example.admin.service;

import org.example.common.utils.CommonUtil;
import org.example.common.utils.DateTimeUtil;
import org.example.db.entity.Role;
import org.example.db.mapper.RoleMapper;
import org.example.security.service.RoleService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminRoleService {


    RoleService roleService;

    public AdminRoleService(RoleService roleService) {
        this.roleService = roleService;
    }

    public void addRole(Role role){

        int count = roleService.addRole(role);

        CommonUtil.isSqlExcute(count);
    }

    public List<Role> listRole(){
        return roleService.getAllRoles();
    }

    public void updateRole(Role role){
        int count = roleService.updateRole(role);
        CommonUtil.isSqlExcute(count);
    }
}
